package cn.zwxky.android.staff.HomePage;

import android.content.Context;
import android.view.View;

import com.zgscwjm.lsfbbasetemplate.Event.LsfbEvent;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

import cn.zwxky.android.staff.R;


/**
 * Created by Administrator on 2017/3/24 0024.
 */

public class LocationAdapter extends CommonRecycAdapter<LocationBean.ListBean> {
    public LocationAdapter(Context context, List<LocationBean.ListBean> list, int layoutId) {
        super(context, list, layoutId);
    }

    @Override
    public void convert(ViewHolderRecyc holder, final LocationBean.ListBean model) {
//       holder.setText(R.id.text,"北纬34°43′20″   东经34°43′20″    海拔530米");
       holder.setText(R.id.text,"北纬"+model.getLongitude()+"    东经"+model.getLatitude()+"    海拔"+model.getElevation()+"米");
       holder.setText(R.id.text2,"记录时间："+model.getTime());

        holder.setOnLoingClick(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {

                LocationClickEvent even = new LocationClickEvent();
                even.setData(model);
                LsfbEvent.getInstantiation().post(even);

                return false;
            }
        });

    }

}
